Subscribe Us

Responsive Advertisement

Advertisement

beecrowd | 1329 Head or Tail solution in cpp

 

beecrowd | 1329 Head or Tail solution in cpp

by ujjal roy



#include<bits/stdc++.h>

using namespace std;

main()

{

    int t,i,a,b,n;

    while(1)

    {

        cin>>t;

        if(t==0) break;

    a=0;

    b=0;

    for(i=0;i<t;i++)

    {

        cin>>n;

        if(n==0)a++;

        else b++;

    }

    cout<<"Mary won "<<a<<" times and John won "<<b<<" times"<<endl;

    }


    return 0;

}


Post a Comment

0 Comments